//
//  WPCommunicationCommunityTVC.m
//  wobingwoyi
//
//  Created by WGP on 16/9/1.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPCommunicationCommunityTVC.h"
#import "WPVideoModel.h"

#define placeholderImageName @"videoPic"

@interface WPCommunicationCommunityTVC ()

@end
@implementation WPCommunicationCommunityTVC

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = GlobalBgColor;
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
    }
    return self;
}

-(void)setupUI
{
    [self videoImageView];
}


-(UIImageView *)videoImageView
{
    if (_videoImageView == nil)
    {
        _videoImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_videoImageView];
        
        [_videoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(10);
            make.left.right.bottom.equalTo(self.contentView);
        }];
    }
    return _videoImageView;
}

-(void)setModel:(WPVideoModel *)model
{
    _model = model;
    [self.videoImageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:placeholderImageName]];
}


@end
